import request from '@/config/axios'

// 荣誉奖项 VO
export interface StudentHonorVO {
  id: string // 主键
  accountId: number // 账号ID
  studentCode: string // 冗余-学号
  studentName: string // 冗余-姓名
  honorName: string // 荣誉名称
  honorTime: Date // 荣誉获得时间
  honorType: string // 荣誉类型
  teamHonor: string // 个人/集体
  ranking: string // 名次
  mentorId: number // 导师ID
  mentorCode: string // 导师
  mentorName: string // 导师姓名
  attachment: string // 附件
  remark: string // 备注
  reviewStatus: string // 审核状态
  reviewSubmitTime: Date // 审核提交时间
  reviewer: number // 审核人ID
  reviewerName: string // 审核人姓名
  reviewTime: Date // 审核时间
  reviewComments: string // 审核意见
}

export interface StudentHonorAuditReqVO {
  id: string // 主键
  reviewStatus: string // 审核状态
  reviewComments: string // 审核意见
}

// 荣誉奖项 API
export const StudentHonorApi = {
  // 查询荣誉奖项分页
  getStudentHonorPage: async (params: any) => {
    return await request.get({ url: `/core/student-honor/page`, params })
  },

  // 查询荣誉奖项详情
  getStudentHonor: async (id: string) => {
    return await request.get({ url: `/core/student-honor/get?id=` + id })
  },

  // 新增荣誉奖项
  createStudentHonor: async (data: StudentHonorVO) => {
    return await request.post({ url: `/core/student-honor/create`, data })
  },

  // 修改荣誉奖项
  updateStudentHonor: async (data: StudentHonorVO) => {
    return await request.put({ url: `/core/student-honor/update`, data })
  },

  // 删除荣誉奖项
  deleteStudentHonor: async (id: string) => {
    return await request.delete({ url: `/core/student-honor/delete?id=` + id })
  },

  // 导出荣誉奖项 Excel
  exportStudentHonor: async (params) => {
    return await request.download({ url: `/core/student-honor/export-excel`, params })
  },

  // 审核荣誉奖项
  auditStudentHonor: async (data: StudentHonorAuditReqVO) => {
    return await request.put({ url: `/core/student-honor/audit`, data })
  },

  // 获得荣誉奖项审核数据
  getStudentHonorAudit: async (id: string) => {
    return await request.get({ url: `/core/student-honor/get-audit-detail?id=` + id })
  }
}
